from enum import Enum
from typing import Callable, List, Dict


class StrategyEnum(Enum):

    # 指数型策略
    peak_and_decline = ("peak_and_decline", "高位峰顶下降")
    three_days_close_not_high = ("three_days_close_not_high", "连续3天收盘价非当日最高点策略")
    three_days_decrease_growth = ("three_days_decrease_growth", "连续3天收盘价非当日最高点策略")
    three_days_volume_decrease = ("three_days_volume_decrease", "连续多天成交量减少")
    three_days_down = ("three_days_down", "连续多天下跌")

    # 节点性质策略
    holiday_proximity = ("holiday_proximity", "节假日前期")


    # 关注策略
    multiple_limit_up = ("multiple_limit_up", "连续涨停")
    valley_and_rise = ("valley_and_rise", "连续多天上涨")

    def __init__(
        self,
        strategy_code: str,
        strategy_name: str,
    ):
        self.strategy_code = strategy_code
        self.strategy_name = strategy_name

    @staticmethod
    def get_strategy_list(self) -> List[Dict[str, str]]:
        """
        获取策略枚举中的所有策略信息。
        """
        return [
            {
                "strategy_code": strategy.strategy_code,
                "strategy_name": strategy.strategy_name,
            }
            for strategy in StrategyEnum
        ]

    @staticmethod
    def get_strategy_main(self) -> List["StrategyEnum"]:
        """
        根据单个策略代码获取策略枚举。
        """
        return [
            StrategyEnum.three_days_down,
            StrategyEnum.peak_and_decline,
            StrategyEnum.three_days_volume_decrease,
        ]
